import request from '@/utils/request'

// 查询收款管理列表
export function listChargeOrder(query) {
  return request({
    url: '/system/chargeOrder/list',
    method: 'get',
    params: query
  })
}

// 查询收款统计
export function getAmountCount(query) {
  return request({
    url: '/system/chargeOrder/amountCount',
    method: 'get',
    params: query
  })
}


// 查询收款管理详细
export function getChargeOrder(id) {
  return request({
    url: '/system/chargeOrder/' + id,
    method: 'get'
  })
}

// 新增收款管理
export function addChargeOrder(data) {
  return request({
    url: '/system/chargeOrder',
    method: 'post',
    data: data
  })
}

// 修改收款管理
export function updateChargeOrder(data) {
  return request({
    url: '/system/chargeOrder',
    method: 'put',
    data: data
  })
}

// 收款
export function chargeOrder(data) {
  return request({
    url: '/system/chargeOrder/charge/' + data,
    method: 'put',
  })
}

// 确认收费
export function getPayMode(mode) {
  return request({
    url: '/system/chargeOrder/payMode/' + mode,
    method: 'get'
  })
}

// 确认收费
export function submitCharge(id) {
  return request({
    url: '/system/chargeOrder/submitCharge/' + id,
    method: 'get'
  })
}

// 收款
export function saveOrder(id) {
  return request({
    url: '/system/chargeOrder/saveOrder/' + id,
    method: 'put',
  })
}

// 删除收款管理
export function delChargeOrder(id) {
  return request({
    url: '/system/chargeOrder/' + id,
    method: 'delete'
  })
}

// 删除缓存状态
export function delOrder(id) {
  return request({
    url: '/system/chargeOrder/delOrder/' + id,
    method: 'delete'
  })
}


// 导出收款管理
export function exportChargeOrder(query) {
  return request({
    url: '/system/chargeOrder/export',
    method: 'get',
    params: query
  })
}

//审核通过
export function auditStatusPass(id) {
  return request({
    url: '/system/chargeOrder/auditStatus/' + id,
    method: 'post'
  })
}

// 反审核通过
export function auditNotPassStatus(id) {
  return request({
    url: '/system/chargeOrder/auditNotStatus/' + id,
    method: 'post'
  })
}


// 查询舱单信息
export function queryManifstRoad(query) {
  return request({
    url: '/kmwlpts/manifestRoadList/queryManifestGL',
    method: 'get',
    params: query
  })
}


// 查询舱单信息
export function listManifestIdList(query) {
  return request({
    url: '/kmwlpts/manifestRoadList/queryManifestIdListGL',
    method: 'get',
    params: query
  })
}

// 修改舱单货值
export function updateManifestVal(data) {
  return request({
    url: '/kmwlpts/manifestRoadList/updateManifestVal',
    method: 'post',
    data: data,
    timeout: 60000 // 20秒
  })
}


// 判断作业单费用是否全部缴清
export function checkIsAllCharge(billCode) {
  return request({
    url: 'system/chargeOrder/judgment/' + billCode,
    method: 'get',
    timeout: 60000 // 20秒
  })
}


